﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Epitech.Krisk.Xna.UI.Game.InGame.Gameplay.Objectifs;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

namespace Epitech.Krisk.Xna.UI.Game.InGame.Gameplay
{
    public abstract class QuestCard
    {
        public Texture2D Texture { get; set; }

        private static List<QuestCard> _questCards;

        public static List<QuestCard> QuestCards
        {
            get { return _questCards; }
            set { _questCards = value; }
        }
        
        public static void Init(ContentManager content)
        {
            _questCards = new List<QuestCard>
                             {
                                 new AsiaSouthAmerica(),
                                 new EighteenTerritories(),
                                 new EuropeOceaniePlusOne(),
                                 new EuropeSouthAmericaPlusOne(),
                                 new NorthAmericaAfrica(),
                                 new NorthAmericaOceanie(),
                                 new TweentyFourTerritories()
                             };
            foreach (var questCard in QuestCards)
            {
                questCard.LoadContent(content);
            }
        }
        

        protected static bool CheckAllContinent(String continent, Player pl)
        {
            bool ok = true;

            foreach (var territory in Continent.Continents[continent].Territories)
            {
                if (territory.Owner != pl)
                    ok = false;
            }

            return ok;
        }

        public int ID { get; set; }

        public abstract bool IsValidate(Player pl);
        public abstract void LoadContent(ContentManager content);
    }
}
